package it.okkam.utility;

import it.okkam.costants.Costanti;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

/** 
 * ConfigReader e' la classe  java che legge il file di configurazione
 * 
 * @param  		
 * @author      Nicola Petri  
 * @version 	1.0
 */

public class ConfigReader {
	
	public static String PATH_LIN;
	public static String fileCoordLavis, fileCoordGiovo , fileCoordFolgaria;
	public static String fileAttrLavis , fileAttrGiovo , fileAttrFolgaria;
	public static String fileEdifLavis ,fileEdifGiovo ,fileEdifFolgaria ;
	public static String fileEdifPertLavis , fileEdifPertFolgaria, fileFondGiovo;
	public static String fileEdifPertGiovo ,fileFondLavis ,fileFondFolgaria;
	public static String fileFondPertLavis ,fileFondPertGiovo ,fileFondPertFolgaria;
	public static String minLatGiovo , minLonGiovo , maxLatGiovo , maxLonGiovo;
	public static String minLatFolgaria , minLonFolgaria , maxLatFolgaria , maxLonFolgaria;
	public static String minLatLavis , minLonLavis , maxLatLavis , maxLonLavis;	
	public static String comuni, fileCambiamenti,cambiamenti ;
	public static void  configReader() {
		Properties properties = new Properties();

	    File confFile = new File(Costanti.CONFIG_FILE_LIN);{

	    try {
	    	FileInputStream fisConf = new FileInputStream(confFile);
	        properties.load(fisConf);
	        fisConf.close();
	        } catch (Exception e) {        	
	        	e.printStackTrace();
	        	System.exit(1);

	         }

	        fileCoordGiovo = properties.getProperty("fileCoordGiovo");
	        fileCambiamenti= properties.getProperty("fileCambiamentiMay2013");
	        fileCoordLavis = properties.getProperty("fileCoordLavis");
	        fileCoordFolgaria = properties.getProperty("fileCoordFolgaria");
	        fileAttrLavis = properties.getProperty("fileAttrLavis");
	        fileAttrGiovo = properties.getProperty("fileAttrGiovo");
	        fileAttrFolgaria = properties.getProperty("fileAttrFolgaria");
	        fileEdifLavis = properties.getProperty("fileEdifLavis");
	        fileEdifGiovo = properties.getProperty("fileEdifGiovo");
	        fileEdifFolgaria = properties.getProperty("fileEdifFolgaria");
	        fileEdifPertLavis = properties.getProperty("fileEdifPertLavis");
	        fileEdifPertGiovo = properties.getProperty("fileEdifPertGiovo");
	        fileEdifPertFolgaria = properties.getProperty("fileEdifPertFolgaria");
	        fileFondLavis = properties.getProperty("fileFondLavis");
	        fileFondGiovo = properties.getProperty("fileFondGiovo");
	        fileFondFolgaria = properties.getProperty("fileFondFolgaria");
	        fileFondPertLavis = properties.getProperty("fileFondPertLavis");
	        fileFondPertGiovo = properties.getProperty("fileFondPertGiovo");
	        fileFondPertFolgaria = properties.getProperty("fileFondPertFolgaria");
	        minLatGiovo=properties.getProperty("minLatGiovo");
	        minLonGiovo=properties.getProperty("minLonGiovo");
	        maxLatGiovo=properties.getProperty("maxLatGiovo");
	        maxLonGiovo=properties.getProperty("maxLonGiovo");
	        minLatFolgaria=properties.getProperty("minLatFolgaria");
	        minLonFolgaria=properties.getProperty("minLonFolgaria");
	        maxLatFolgaria=properties.getProperty("maxLatFolgaria");
	        maxLonFolgaria=properties.getProperty("maxLonFolgaria");
	        minLatLavis=properties.getProperty("minLatLavis");
	        minLonLavis=properties.getProperty("minLonLavis");
	        maxLatLavis=properties.getProperty("maxLatLavis");
	        maxLonLavis=properties.getProperty("maxLonLavis");
	        comuni=properties.getProperty("fileComuni");
	        cambiamenti=properties.getProperty("cambiamenti");
	        fileCambiamenti=properties.getProperty("fileCambiamenti");
	}
}
}
